﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Linq;
namespace MMMaze
{
    public enum WallStatus
    {
        Normal,
        ShowInTop,
        InPlayback

    }
    public class Wall
    {
        Panel _CorePanel;
        public Panel CorePanel
        {
            get
            { return _CorePanel; }
            set
            {
                _CorePanel = value;
                _Close = new Button()
                {
                    Width = 20,
                    Height = 20,
                    Content = new TextBlock () { Text = "X" },
                    HorizontalAlignment = HorizontalAlignment.Right,
                    VerticalContentAlignment = VerticalAlignment.Top
                };
                _CorePanel.Children.Add(_Close);
            }
        }
        Button _Close;
        public Button CloseButton
        {
            get { return _Close; }


        }
        public LinearGradientBrush ForgPrush
        {
            get 
            {
                return (LinearGradientBrush)this.CorePanel.OpacityMask;
            } 
            set
            {
                this.CorePanel.OpacityMask = value;
            }
        }

        public PlaneProjection OrginalProjection { get; set; }
        WallStatus _Status=WallStatus.Normal  ;
        public WallStatus Status
        {

            get 
            {

                return _Status;
            }

            set
            {
                if (value == WallStatus.ShowInTop)
                {
                    CloseButton.Visibility = Visibility.Visible;
                }
                else
                {

                    CloseButton.Visibility = Visibility.Collapsed;
                }

                _Status = value;
            }


        }

 



        static public Func<Panel> DefaultPanelCreator = () => new StackPanel()
        {

        };


        static public Func<Panel, Panel> DefaultPanelDecorator = p =>
        {

            p.Background = new SolidColorBrush
                (
                   new Color
                   {
                       A = 70,
                       R = 255
                   }
                );
            return p;
        };


    }
}
